import sqlite3

class DataBase:
    def __init__(self, db_url):
        self.db_url = db_url
        self.connection = None

    def connect(self):
        self.connection = sqlite3.connect(self.db_url)

    def disconnect(self):
        if self.connection:
            self.connection.close()

    def execute_query(self, query, params=None):
        if not self.connection:
            self.connect()
        cursor = self.connection.cursor()
        cursor.execute(query, params or ())
        self.connection.commit()
        return cursor
    